﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PHMEE.MqttClient
{
    public class WriteFileHelper
    {
        public static void WriteFile(string SN, string FileName, string content)
        {
            string filePath = $@"{AppDomain.CurrentDomain.BaseDirectory}/DataFile/{SN}/{DateTime.Now.ToString("yyyyMMddHH")}/";
            if (!Directory.Exists(filePath))
            {
                Directory.CreateDirectory(filePath);
            }
            //构建完整的文件路径，并写入内容
            string fullFilePath = Path.Combine(filePath, FileName);
            File.WriteAllText(fullFilePath, content);
        }
    }
}
